<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浮动布局</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        li{
            list-style: none;
        }
        .mi{
            width: 1226px;
            height: 614px;
            background-color: pink;
            margin: 100px auto 0;
        }
        .left{
            width: 234px;
            height: 614px;
            background-color: purple;
            float: left;
        }
        .right{
            width: 978px;
            height: 614px;
            background-color: skyblue;
            float: right;
        }
        .right ul li{
            width: 234px;
            height: 300px;
            background-color: rgb(245, 16, 54);
            float: left;
            margin-bottom: 14px;
            margin-right: 14px
        }
        /* 让第4和8个li去掉右边距 */
        .right ul li:nth-child(4n){
            margin-right: 0px;
        }
        /* 第五个到第八个li去掉下边距 */
        .right ul li:nth-child(n+5){
            margin-bottom: 0px;
        }
    </style>
</head>
<body>
    <div class="mi">
        <div class="left"></div>
        <div class="right">
            <ul>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
            </ul>
        </div>
    </div>
</body>
</html>